package com.api.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.api.dao.RequestHeaderMapper;
import com.api.entity.RequestHeader;
import com.api.service.RequestHeaderService;

@Service
public class RequestHeaderServiceImpl implements RequestHeaderService{

	@Autowired
	private RequestHeaderMapper requestHeaderMapper;

	@Override
	public void add(RequestHeader requestHeader) {
		requestHeader.preInsert();
		 this.requestHeaderMapper.insert(requestHeader);
	}

	@Override
	public RequestHeader getRequestHeader(RequestHeader requestHeader) {
		return this.requestHeaderMapper.get(requestHeader);
	}

	@Override
	public RequestHeader getRequestHeader(String id) {
		return this.requestHeaderMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<RequestHeader> getRequestHeaderList(String api_Id) {
		return this.requestHeaderMapper.getRequestHeaderList(api_Id);
	}

	@Override
	public int delete(String api_Id) {
		return this.requestHeaderMapper.deleteByPrimaryKey(api_Id);
	}

}
